<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center personalInformation_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub personalInformation_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  personalInformation_fd0_0_c0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">&#xE794;</text>
				</view>
				<text class='personalInformation_fd0_0_c1'>车型价格</text>
				<view class='flex flex-wrap align-center personalInformation_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#1A66FA"></u-loading>
			<view>加载中</view>
		</view>
		<template v-else>
			<view class="content_bg">
				<view class="car_top flex align-center">
					<view class="top_le">
						<view class="card_no">
							<view class="card_no_text flex align-center">
								<text>{{carInfo.name}}</text>
							</view>
						</view>
						<view class="label_list">
							<view class="label_item flex align-center justify-center">{{carInfo.brand_name}}</view>
						</view>
						<view class="store_name">{{carInfo.store_name}}</view>
					</view>
					<view class="top_ri">
						<u-lazy-load height="146" border-radius="16" class="car_img" :image="carInfo.image" :loading-img="loadingImg" :error-img="errorImg"></u-lazy-load>
					</view>
				</view>
			</view>
			<view class="content_bg pad24">
				<view class="item_title">基本租金</view>
				<!-- <view class="item_info flex align-center justify-between">
					<view class="item_info_le">区分周中周末</view>
					<view class="item_info_ri">
						<u-switch v-model="checked" active-color="#1A66FA" size="28"></u-switch>
					</view>
				</view> -->
				<view class="item_info flex align-center justify-between">
					<view class="item_info_le">价格</view>
					<view class="item_info_ri flex align-center">
						<!-- <text>
							<text class="item_info_ri_1">￥</text>
							<text class="item_info_ri_2">420</text>
						</text> -->
						<input v-model="carInfo.price" class="item_info_ri_2 text_right" type="number" placeholder="请输入价格" placeholder-style="font-size:30rpx;color:#999;">
						<!-- <image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image> -->
					</view>
				</view>
				<!-- <view class="item_info flex align-center justify-between">
					<view class="item_info_le">周中价（周日至周四）</view>
					<view class="item_info_ri flex align-center">
						<text>
							<text class="item_info_ri_1">￥</text>
							<text class="item_info_ri_2">420</text>
						</text>
						<image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image>
					</view>
				</view>
				<view class="item_info flex align-center justify-between">
					<view class="item_info_le">周末价（周五至周六）</view>
					<view class="item_info_ri flex align-center">
						<text>
							<text class="item_info_ri_1">￥</text>
							<text class="item_info_ri_2">420</text>
						</text>
						<image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image>
					</view>
				</view> -->
			</view>
			<view class="flex align-center justify-between feedback_flex_4" @tap.stop="savePrice">
				<view class='feedback_fd4_0'>设置</view>
			</view>
		</template>
		
		
		
		<!-- <view class="content_bg pad24">
			<view class="item_title">其他费用</view>
			<view class="item_info flex align-center justify-between">
				<view class="item_info_le">基本保障服务费</view>
				<view class="item_info_ri flex align-center">
					<text>
						<text class="item_info_ri_1">￥</text>
						<text class="item_info_ri_2">420</text>
					</text>
					<image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image>
				</view>
			</view>
			<view class="item_info flex align-center justify-between">
				<view class="item_info_le">超时费</view>
				<view class="item_info_ri flex align-center">
					<text>
						<text class="item_info_ri_1">￥</text>
						<text class="item_info_ri_2">420</text>
					</text>
					<image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image>
				</view>
			</view>
			<view class="item_info flex align-center justify-between">
				<view class="item_info_le">租车押金</view>
				<view class="item_info_ri flex align-center">
					<text>
						<text class="item_info_ri_1">￥</text>
						<text class="item_info_ri_2">420</text>
					</text>
					<image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image>
				</view>
			</view>
		</view>
		<view class="content_bg pad24">
			<view class="item_title">高级设置</view>
			<view class="item_info flex align-center justify-between" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/index/priceSet/advancedSet`">
				<view class="item_info_le">价格高级设置</view>
				<view class="item_info_ri flex align-center">
					<text class="item_info_ri_3">设置</text>
					<image class="item_info_ri_icon" :src='STATIC_URL+"208.png"' mode="aspectFill"></image>
				</view>
			</view>
			<view class="set_tip">*车辆整备费不计免陪服务费、违章押金、上门送取费用请前往【门店价格】设置</view>
		</view> -->
		<!-- <view style="height: 48rpx;"></view> -->
		
		
	</view>
</template>
<script>
	import UploadImage from '@/common/utils/upload-image.js'
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"loadingImg": "",
				"errorImg": "",
				"imageUrl": "https://speed.zhongchuxing.com/gjdimages/476.png",
				"checked": false,
				"carInfo": "",
				"is_submit": false,
				"isShow": true,
			};
		},
		computed: {
			
		},
		watch: {},
		onLoad(options) {
			let { carInfo } = options;
			if (carInfo !== undefined) this.carInfo = JSON.parse(carInfo);
			if (this.carInfo) {
				this.carInfo.price = Number(this.carInfo.price);
			}
			console.log(this.carInfo);
			setTimeout(() => {
				this.isShow = false;
			}, 300)
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			savePrice() {
				if (this.is_submit) return;
				if (!this.carInfo.price) {
					this.$message.info('请输入金额');
					return;
				}
				if (this.carInfo.price <= 0) {
					this.$message.info('金额必须大于0');
					return;
				}
				this.is_submit = true;
				this.$api.post(global.apiUrls.setPrice, {
					id: this.carInfo.id,
					store_id: this.carInfo.store_id,
					price: this.carInfo.price
				}).then(res => {
					this.$message.info(res.data.info);
					if (res.data.code == 1) {
						setTimeout(() => {
							uni.navigateBack();
						}, 800)
					} else {
						this.is_submit = false;
					}
				}).catch(err => {
					this.is_submit = false;
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	.content_bg {
		background: #fff;
		border-radius: 16rpx;
		margin: 24rpx 24rpx 0;
	}
	.item_title {
		font-weight: bold;
		font-size: 30rpx;
		color: rgba(0,0,0,0.8);
		padding: 28rpx 0;
	}
	.item_info {
		padding: 28rpx 0;
		border-top: 1px solid #eee;
		.item_info_le {
			font-weight: 400;
			font-size: 30rpx;
			color: #222222;
		}
		.item_info_ri {
			font-weight: 500;
			color: #222222;
			.item_info_ri_1 {
				font-size: 24rpx;
			}
			.item_info_ri_2 {
				font-size: 30rpx;
			}
			.item_info_ri_3 {
				font-weight: 500;
				font-size: 30rpx;
				color: #999999;
			}
			.item_info_ri_icon {
				width: 28rpx;
				height: 28rpx;
				margin-left: 12rpx;
			}
			.text_right {
				text-align: right;
			}
		}
	}
	.set_tip {
		font-weight: 400;
		font-size: 22rpx;
		color: #EF2E28;
		line-height: 26rpx;
		padding-bottom: 28rpx;
	}
	.car_top {
		padding-left: 24rpx;
		.top_le {
			width: calc(100% - 222rpx);
			.card_no {
				padding-top: 16rpx;
				.card_no_text {
					font-weight: bold;
					font-size: 36rpx;
					color: #222222;
				}
				
			}
			.label_list {
				margin-top: 20rpx;
				overflow: hidden;
				.label_item {
					float: left;
					background: #E9EEFF;
					padding: 4rpx 20rpx;
					margin: 0 12rpx 0rpx 0;
					border-radius: 8rpx;
					font-weight: 400;
					font-size: 22rpx;
					color: #1A66FA;
				}
			}
			.store_name {
				padding: 16rpx 0;
				font-weight: bold;
				font-size: 30rpx;
				color: #222222;
			}
		}
		.top_ri {
			width: 222rpx;
			height: 146rpx;
			.car_img {
				width: 222rpx;
				height: 146rpx;
			}
			/deep/.u-lazy-item {
				width: 222rpx !important;
				height: 146rpx !important;
			}
		}
	}
	.pad24 {
		padding: 0 24rpx;
	}
	
	.feedback_fd4_0 {
		width: 702rpx;
		height: 96rpx;
		line-height: 96rpx;
		text-align: center;
		background: #1A66FA;
		color: #ffffff;
		font-size: 30rpx;
		font-weight: 500;
		border-radius: 16rpx;
	}
	
	.feedback_flex_4 {
		width: 750rpx;
		height: 120rpx;
		overflow: hidden;
		position: fixed;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
		display: flex;
		justify-content: center;
		background: #fff;
	}
	
	.personalInformation_picker2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		height: 100rpx;
	}

	.personalInformation_picker2_0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #BFBFBF;
	}

	.personalInformation_picker2_0_c1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.personalInformation_picker2_0_c2 {
		color: rgba(44, 143, 255, 1);
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
	}

	.personalInformation_fd1_0 {
		// margin-top: 32rpx;
		height: 96rpx;
		border-top: 1px solid #eee;
	}

	.personalInformation_fd1_0_c0 {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0,0,0,0.6);
	}

	.personalInformation_fd1_0_c1_image {
		width: 72rpx;
		height: 72rpx;
		border-radius: 50%;
	}

	.personalInformation_fd1_1 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_1_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_1_c1 {
		font-weight: 400;
		font-size: 28rpx;
		color: #222222;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.personalInformation_fd1_2 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_2_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_2_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.personalInformation_fd1_3 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_3_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_3_c1 {
		font-weight: 500;
		font-size: 28rpx;
		color: rgba(0,0,0,0.8);
	}

	.personalInformation_flex_1 {
		background: #fff;
		border-radius: 16rpx;
		padding: 24rpx 24rpx 0rpx 24rpx;
		margin: 16rpx 24rpx 0;
	}

	.personalInformation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.personalInformation_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #111;
	}

	.personalInformation_fd0_0_c1 {
		font-size: 32rpx;
		font-weight: bold;
		color: #111111;
	}

	.personalInformation_fd0_0_c2 {
		width: 36rpx;
		height: 36rpx;
	}

	.personalInformation_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background: #fff;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: #f6f7fb;
		background-size: 100% auto !important;
	}
</style>